using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEngine;

public partial class LitMenu
{
    [MenuItem("LitMenu/Table/OpenFolder")]
    public static void OpenTablePath()
    {
        string path = $"../TableTool/";
        path = Path.Combine(Application.dataPath, path);
        Process.Start(new ProcessStartInfo() { FileName = path });
    }

    [MenuItem("LitMenu/Table/Generate")]
    public static void ReadTable()
    {
        string path = $"../TableTool/";
        path = Path.Combine(Application.dataPath, path);
        string batPath = $"{path}gen.bat";
        Process proc = new();
        proc.StartInfo.FileName = batPath;
        proc.StartInfo.WorkingDirectory = path;
        proc.Start();
        proc.WaitForExit();
    }
}
